package com.example.im.ui.fragment

import android.content.Context
import android.view.View
import com.example.im.R
import com.example.im.callback.OnClickRoomListener
import com.example.im.mvp.base.BasePresenter
import com.example.im.ui.abstracts.AbstractBaseFragment
import kotlinx.android.synthetic.main.fragment_room_create.*

class RoomCreateFragment : AbstractBaseFragment<BasePresenter<*>>(), View.OnClickListener {

    var mOnClickRoomListener: OnClickRoomListener? = null

    companion object {
        fun newInstance(): RoomCreateFragment {
            return RoomCreateFragment()
        }
    }

    override fun onAttach(context: Context) {
        super.onAttach(context)
        mOnClickRoomListener = context as OnClickRoomListener
    }

    override val layoutId: Int
        get() = R.layout.fragment_room_create

    override fun initView() {
        tv_room_create.setOnClickListener(this)
    }

    override fun initPresenter() {

    }

    override fun initLazyLoad() {

    }

    override fun onClick(v: View?) {
        mOnClickRoomListener!!.onClickCreate(v!!, et_room_name.text.toString())
    }

}